from rest_framework_simplejwt.serializers import TokenObtainPairSerializer


class MyToekenObtainPairSerializer(TokenObtainPairSerializer):
    @classmethod
    def get_token(cls, user):
        return super().get_token(user)

    def validate(self, attrs):
        data = super().validate(attrs)
        return {
            "data": data,
            "code": 200,
            "message": "success",
            "user_id": self.user.id
        }
